<template>
  <div id="panelOption">
    <!-- panel option -->
    <select-panel-data
      v-if="['bar', 'line'].includes(currentPanelName)"
    ></select-panel-data>
    <table-panel v-if="currentPanelName === 'table'">
    </table-panel>
    <scroll-table-panel v-if="currentPanelName === 'scrolltable'">
    </scroll-table-panel>
    <sum-panel v-if="currentPanelName === 'sum'">
    </sum-panel>
    <line-panel
      v-if="currentPanelName === 'line'"
    ></line-panel>
    <bar-panel v-if="currentPanelName === 'bar'"></bar-panel>
    <pie-panel v-if="currentPanelName === 'pie'"></pie-panel>
    <gauge-panel
      v-if="currentPanelName === 'gauge'"
    ></gauge-panel>
  </div>
</template>
<script>
// 图表配置项
import selectPanelData from "./selectPanelData";
import "./js/supportPanels"; // 注册全局组件

export default {
  props: {},
  components: {
    selectPanelData,
  },
  data() {
    return {
      currentPanelName: "",
    };
  },
  mounted() {
    this.currentPanelName = this.$store.getters.getCurrentPanelName;
  },
  watch: {
    "$store.state.addPanel.currentPanelName": function (val) {
      this.currentPanelName = val;
    },
  },
  methods: {},
};
</script>
<style lang="less" scoped>
#panelOption {
  height: 100%;
  font-size: 0.25rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  background-color: #13227a;
  padding: 0 0.3rem 0.3rem 0.3rem;
  overflow: auto;
}
#panelOption::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.container {
  .containerTitle {
    cursor: pointer;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .iconBox {
    width: 12%;
    display: inline-block;
  }
}
.detail {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 10px;
}
.container > span {
  display: inline-block;
  width: 88%;
}
.padding_border {
  padding: 0.2rem 0;
}
.panelStyleBGC {
  display: flex;
  justify-content: space-between;
  align-items: center;

  /deep/.el-color-picker__trigger {
    width: 30px;
    height: 30px;
  }
}

/deep/.el-collapse-item__header {
  background-color: transparent;
  color: #ffffff;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/deep/.el-collapse-item__wrap {
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/deep/.el-collapse-item__content {
  color: #ffffff;
  padding-bottom: 0;
}
/deep/.el-collapse {
  border: none;
}
@media screen and (max-width: 1280px) {
  #panelOption {
    padding: 0 0.6rem 0.6rem 0.6rem;
  }
  .container .containerTitle,
  .padding_border {
    padding: 0.6rem 0;
  }
}
</style>


<style lang="less">
.detail {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 10px;
}
.padding_border {
  padding: 0.2rem 0;
}
.panelStyleBGC {
  display: flex;
  justify-content: space-between;
  align-items: center;

  /deep/.el-color-picker__trigger {
    width: 30px;
    height: 30px;
  }
}
/deep/.el-collapse-item__header {
  background-color: transparent;
  color: #ffffff;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/deep/.el-collapse-item__wrap {
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/deep/.el-collapse-item__content {
  color: #ffffff;
  padding-bottom: 0;
}
/deep/.el-collapse {
  border: none;
}
@media screen and (max-width: 1280px) {
  .container .containerTitle,
  .padding_border {
    padding: 0.6rem 0;
  }
}
</style>>
